home *** CD-ROM | disk | FTP | other *** search
/ SGI Performance Co-Pilot 1.3 / SGI Performance Co-Pilot 1.3.iso / dist / dist6.4 / pcp.idb / usr / share / catman / u_man / cat3 / PMAPI / pmextractvalue.z / pmextractvalue
Text File  |  1997-04-03  |  11KB  |  199 lines

  1.  
  2.  
  3.  
  4. PPPPMMMMEEEEXXXXTTTTRRRRAAAACCCCTTTTVVVVAAAALLLLUUUUEEEE((((3333))))                                            PPPPMMMMEEEEXXXXTTTTRRRRAAAACCCCTTTTVVVVAAAALLLLUUUUEEEE((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ppppmmmmEEEExxxxttttrrrraaaaccccttttVVVVaaaalllluuuueeee - extract a performance metric value from a pmResult
  10.      structure
  11.  
  12. CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ppppccccpppp////ppppmmmmaaaappppiiii....hhhh>>>>
  14.  
  15.      iiiinnnntttt ppppmmmmEEEExxxxttttrrrraaaaccccttttVVVVaaaalllluuuueeee((((iiiinnnntttt vvvvaaaallllffffmmmmtttt,,,, ppppmmmmVVVVaaaalllluuuueeee ****iiiivvvvaaaallll,,,, iiiinnnntttt iiiittttyyyyppppeeee,,,, ppppmmmmAAAAttttoooommmmVVVVaaaalllluuuueeee
  16.      ****oooovvvvaaaallll,,,, iiiinnnntttt oooottttyyyyppppeeee))))
  17.  
  18.      cccccccc ............ ----llllppppccccpppp
  19.  
  20. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  21.      The _p_m_V_a_l_u_e structure is embedded within the _p_m_R_e_s_u_l_t structure that is
  22.      used to return one or more performance metrics; see ppppmmmmFFFFeeeettttcccchhhh(3).
  23.  
  24.      All performance metric values may be encoded in a _p_m_A_t_o_m_V_a_l_u_e union,
  25.      defined as follows;
  26.  
  27.           typedef union {
  28.               __int32_t    l;     /* 32-bit signed */
  29.               __uint32_t   ul;    /* 32-bit unsigned */
  30.               __int64_t    ll;    /* 64-bit signed */
  31.               __uint64_t   ull;   /* 64-bit unsigned */
  32.               float        f;     /* 32-bit floating point */
  33.               double       d;     /* 64-bit floating point */
  34.               char         *cp;   /* char ptr */
  35.               void         *vp;   /* void ptr */
  36.           } pmAtomValue;
  37.  
  38.      The routine ppppmmmmEEEExxxxttttrrrraaaaccccttttVVVVaaaalllluuuueeee provides a convenient mechanism for extracting
  39.      values from the _p_m_V_a_l_u_e part of a _p_m_R_e_s_u_l_t structure, optionally
  40.      converting the data type, and making the result available to the
  41.      application programmer.
  42.  
  43.      _i_t_y_p_e defines the data type of the input value held in _i_v_a_l according to
  44.      the storage format defined by _v_a_l_f_m_t (see ppppmmmmFFFFeeeettttcccchhhh(3)).  _o_t_y_p_e defines the
  45.      data type of the result to be placed in _o_v_a_l.
  46.  
  47.      The value for _i_t_y_p_e is typically extracted from a _p_m_D_e_s_c structure,
  48.      following a call to ppppmmmmLLLLooooooookkkkuuuuppppDDDDeeeesssscccc(3) for a particular performance metric.
  49.  
  50.      The _o_t_y_p_e value should be one of the defined PPPPMMMM____TTTTYYYYPPPPEEEE____...  values, that
  51.      have a 1:1 correspondence with the fields in the _p_m_A_t_o_m_V_a_l_u_e union.
  52.  
  53.      Normally the _v_a_l_f_m_t parameter would be plucked from the same _p_m_R_e_s_u_l_t
  54.      structure that provides the _i_v_a_l parameter, and if _v_a_l_f_m_t specifies
  55.      PPPPMMMM____VVVVAAAALLLL____IIIINNNNSSSSIIIITTTTUUUU, then the following types are not allowed, as these cannot
  56.      be encoded in 32-bits; ________iiiinnnntttt66664444____tttt, ________uuuuiiiinnnntttt66664444____tttt, ddddoooouuuubbbblllleeee, cccchhhhaaaarrrr **** and vvvvooooiiiidddd ****
  57.      (the corresponding _i_t_y_p_e values are PPPPMMMM____TTTTYYYYPPPPEEEE____66664444, PPPPMMMM____TTTTYYYYPPPPEEEE____UUUU66664444,
  58.      PPPPMMMM____TTTTYYYYPPPPEEEE____DDDDOOOOUUUUBBBBLLLLEEEE, PPPPMMMM____TTTTYYYYPPPPEEEE____SSSSTTTTRRRRIIIINNNNGGGG and PPPPMMMM____TTTTYYYYPPPPEEEE____AAAAGGGGGGGGRRRREEEEGGGGAAAATTTTEEEE respectively).  If
  59.      _v_a_l_f_m_t specifies PPPPMMMM____VVVVAAAALLLL____PPPPTTTTRRRR, then the value will be extracted from the
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. PPPPMMMMEEEEXXXXTTTTRRRRAAAACCCCTTTTVVVVAAAALLLLUUUUEEEE((((3333))))                                            PPPPMMMMEEEEXXXXTTTTRRRRAAAACCCCTTTTVVVVAAAALLLLUUUUEEEE((((3333))))
  71.  
  72.  
  73.  
  74.      associated _p_m_V_a_l_u_e_B_l_o_c_k structure, and the ________iiiinnnntttt33332222____tttt, ________uuuuiiiinnnntttt33332222____tttt and
  75.      ffffllllooooaaaatttt options (_i_t_y_p_e being PPPPMMMM____TTTTYYYYPPPPEEEE____33332222, PPPPMMMM____TTTTYYYYPPPPEEEE____UUUU33332222 and PPPPMMMM____TTTTYYYYPPPPEEEE____FFFFLLLLOOOOAAAATTTT
  76.      respectively) are not allowed, as PPPPMMMM____VVVVAAAALLLL____IIIINNNNSSSSIIIITTTTUUUU is the appropriate
  77.      encoding for these.
  78.  
  79.      The following table defines the various possibilities for the type
  80.      conversion -- the input type (_i_t_y_p_e) is shown vertically, and the output
  81.      type (_o_t_y_p_e) is shown horizontally.  Y means the conversion is always
  82.      acceptable, N means the conversion can never be performed (the function
  83.      returns PPPPMMMM____EEEERRRRRRRR____CCCCOOOONNNNVVVV), P means the conversion may lose accuracy (but no
  84.      error status is returned), T means the result may be subject to high-
  85.      order truncation (in which case the function returns PPPPMMMM____EEEERRRRRRRR____TTTTRRRRUUUUNNNNCCCC) and S
  86.      means the conversion may be impossible due to the sign of the input value
  87.      (in which case the function returns PPPPMMMM____EEEERRRRRRRR____SSSSIIIIGGGGNNNN).  If an error occurs,
  88.      the value represented by _o_v_a_l will be zero (or NNNNUUUULLLLLLLL).  Note that although
  89.      some of the conversions involving the types PPPPMMMM____TTTTYYYYPPPPEEEE____SSSSTTTTRRRRIIIINNNNGGGG and
  90.      PPPPMMMM____TTTTYYYYPPPPEEEE____AAAAGGGGGGGGRRRREEEEGGGGAAAATTTTEEEE are indeed possible, but are marked N - the rationale
  91.      is that ppppmmmmEEEExxxxttttrrrraaaaccccttttVVVVaaaalllluuuueeee should not be attempting to duplicate
  92.      functionality already available in the C library via ssssssssccccaaaannnnffff(3S) and
  93.      sssspppprrrriiiinnnnttttffff(3S).
  94.  
  95.             | 32  |  U32  | 64  |  U64  | FLOAT | DBLE | STRING | AGGR |
  96.      =======|=====|=======|=====|=======|=======|======|========|======|
  97.      32     |  Y  |   S   |  Y  |   S   |   P   |  P   |   N    |  N   |
  98.      U32    |  T  |   Y   |  Y  |   Y   |   P   |  P   |   N    |  N   |
  99.      64     |  T  |  T,S  |  Y  |   S   |   P   |  P   |   N    |  N   |
  100.      U64    |  T  |   T   |  T  |   Y   |   P   |  P   |   N    |  N   |
  101.      FLOAT  | P,T | P,T,S | P,T | P,T,S |   Y   |  Y   |   N    |  N   |
  102.      DBLE   | P,T | P,T,S | P,T | P,T,S |   P   |  Y   |   N    |  N   |
  103.      STRING |  N  |   N   |  N  |   N   |   N   |  N   |   Y    |  N   |
  104.      AGGR   |  N  |   N   |  N  |   N   |   N   |  N   |   N    |  Y   |
  105.  
  106.      In the cases where multiple conversion errors could occur, the first
  107.      encountered error will be notified, and the order of checking is not
  108.      defined.
  109.  
  110.      If the output conversion is to one of the pointer types, i.e. _o_t_y_p_e is
  111.      PPPPMMMM____TTTTYYYYPPPPEEEE____SSSSTTTTRRRRIIIINNNNGGGG or PPPPMMMM____TTTTYYYYPPPPEEEE____AAAAGGGGGGGGRRRREEEEGGGGAAAATTTTEEEE, then the value buffer will have been
  112.      allocated by ppppmmmmEEEExxxxttttrrrraaaaccccttttVVVVaaaalllluuuueeee(3) using mmmmaaaalllllllloooocccc(3C), and it is the caller's
  113.      responsibility to free the space when it is no longer required.
  114.  
  115.      Although this function appears rather complex, it has been constructed to
  116.      assist the development of performance tools that wish to convert values,
  117.      whose type is only known via the _t_y_p_e field in a _p_m_D_e_s_c structure, into a
  118.      canonical type for local processing.
  119.  
  120. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  121.      PPPPMMMMAAAAPPPPIIII(3), ppppmmmmAAAAttttoooommmmSSSSttttrrrr(3), ppppmmmmCCCCoooonnnnvvvvSSSSccccaaaalllleeee(3), ppppmmmmFFFFeeeettttcccchhhh(3), ppppmmmmLLLLooooooookkkkuuuuppppDDDDeeeesssscccc(3),
  122.      ppppmmmmPPPPrrrriiiinnnnttttVVVVaaaalllluuuueeee(3), ppppmmmmTTTTyyyyppppeeeeSSSSttttrrrr(3) and ppppmmmmUUUUnnnniiiittttssssSSSSttttrrrr(3).
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. PPPPMMMMEEEEXXXXTTTTRRRRAAAACCCCTTTTVVVVAAAALLLLUUUUEEEE((((3333))))                                            PPPPMMMMEEEEXXXXTTTTRRRRAAAACCCCTTTTVVVVAAAALLLLUUUUEEEE((((3333))))
  137.  
  138.  
  139.  
  140. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  141.      PPPPMMMM____EEEERRRRRRRR____CCCCOOOONNNNVVVV
  142.  
  143.           Impossible conversion, marked by N in above table
  144.  
  145.      PPPPMMMM____EEEERRRRRRRR____TTTTRRRRUUUUNNNNCCCC
  146.  
  147.           High-order truncation occurred
  148.  
  149.      PPPPMMMM____EEEERRRRRRRR____SSSSIIIIGGGGNNNN
  150.  
  151.           Conversion of negative value to unsigned type attempted
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.